﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyAlbum.Model;

namespace MyAlbum.Services
{
    public class StatisticsService : IStatisticsService
    {
        private IAlbumService _albumService;
        private ISectionService _sectionService;
        private IEntryService _entryService;
        private ITagEntryService _tagsService;
        private IBlogService _blogService;
        public StatisticsService(
                 IAlbumService albumService,
                 ISectionService sectionService,
                 IEntryService entryService,
                 ITagEntryService tagsService,
                 IBlogService blogService)
        {
            this._albumService = albumService;
            this._sectionService = sectionService;
            this._entryService = entryService;
            this._tagsService = tagsService;
            this._blogService = blogService;
        }

        public Statistics Load()
        {
            return new Statistics()
            {
                Albums = _albumService.CountItems(),
                Categories = _sectionService.CountItems(),
                Entries = _entryService.CountItems(),
                Posts = _blogService.CountPosts()
            };
        }
    }
}
